<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<button class="button">click me</button>

<script>
    let buttonElement = document.getElementsByClassName('button')[0];
    buttonElement.addEventListener('click', function (e) {
        console.log(e);
        console.log(this)
    })
</script>

</body>
</html>